<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>选择付款收款方信息表</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var grid = null,payeeTypCd=null,cstId=null,splId=null,purpCd=null,paySchId=null,prjPrdDtlId=null,orgCd=null;
    $(function () {
        var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
        var dialogData = dialog.get('data');//获取data参数
        if(dialogData){
            payeeTypCd=dialogData.payeeTypCd;
            cstId=dialogData.cstId;
            splId=dialogData.splId;
            purpCd=dialogData.purpCd;
            if(!purpCd){
                purpCd="";
            }
            paySchId=dialogData.paySchId;
            prjPrdDtlId=dialogData.prjPrdDtlId;
            orgCd=dialogData.orgCd;
        }

        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/capital/capPayeeInfo/initPayeeList.do',
            parms:{'payeeTypCd':payeeTypCd,'cstId':cstId,'splId':splId,'purpCd':purpCd,'prjPrdDtlId':prjPrdDtlId,'paySchId':paySchId,'orgCd':orgCd},
            method: 'get',
            columns: [
                {display: '收款单位(人)', name: 'rcptUnt', minWidth: 100, align: 'left', enabledSort: false,},
                {display: '收款账号', name: 'accNo', minWidth: 100, align: 'center', enabledSort: false,},
                {display: '开户行', name: 'payeeBkNm', minWidth: 100, align: 'left', enabledSort: false,},
                {display: '开户行号', name: 'payeeBkNo', minWidth: 100, align: 'left', enabledSort: false,},
                {display: '账户类型', name: 'bkAccTypCdNm', minWidth: 100, align: 'left', enabledSort: false,},
            ],
            usePager : false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            checkbox: true,
            isSingleCheck:true,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow: true
        });
        grid.setHeight(100);

        $("#searchBar").ligerForm();

        $("#pageloading").hide();

        //按钮在页面外的Dialog里，给Dialog绑定事件 （onOk 和 onCancel）
        frameElement.dialog.onOk = function () {
            var selectedRows = grid.getSelectedRows();
            if (selectedRows.length != 1) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_SELECT_ONLY_A_ROW, SQ_type: "warning"});
                return;
            }
            var payee=selectedRows[0];
            parent.$("#rcptUnt"+purpCd).val(payee.rcptUnt);
            parent.$("#accNo"+purpCd).val(payee.accNo);
            parent.$("#payeeBkNm"+purpCd).val(payee.payeeBkNm);
            parent.$("#payeeBkNo"+purpCd).val(payee.payeeBkNo);
            //parent.$("#bkAccTypCdNm").val(payee.bkAccTypCdNm);
            parent.liger.get("bkAccTypCd"+purpCd).setValue(payee.bkAccTypCd);
            parent.$("#bkId"+purpCd).val(payee.bkId);
            frameElement.dialog.hide();
        };

        frameElement.dialog.onCancel = function () {
            frameElement.dialog.hide();
        };
    });

</script>

</body>
</html>
